package com.ydd.mapper;

import com.ydd.entity.Tag;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author hgz
 * @since 2023-05-30
 */
@Mapper
public interface TagMapper extends BaseMapper<Tag> {
    @Select("select count(*) from ydd_tag")
    Integer getCount();
    @Select("select * from ydd_tag")
    List<Tag> all();
    //标签修改
    void updateTag(Tag tag) ;
    @Insert("insert into ydd_tag(tagname )" +
            "values " +
            "(#{tagname})")
    void add(Tag tag);
    List<Tag> pagelist(String name);
    @Select("select * from ydd_tag where id=#{id}")
    Tag rowlnfo(Integer id);
    @Delete("delete from ydd_tag where id =#{id}")
    void del(Integer id);
}
